package com.yishusmt.wechatapi.wechatdev.controller;

import com.yishusmt.wechatapi.wechatdev.service.WechatReceiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 微信消息接受发送消息
 *
 * @author zhangyi
 * @date 2018/8/27 11:00
 */
@Controller
@Api(description = "微信对话交互接口")
public class WeChatController {

    @Resource
    private WechatReceiveService wechatReceiveService;

    /**
     * 微信接受消息
     *
     * @return
     */
    @PostMapping("/")
    @ResponseBody
    @ApiOperation(value = "微信接受对话交互接口",httpMethod = "POST")
    public String receive() throws Exception{
        return wechatReceiveService.receiveAndSend();
    }
}
